package com.yx.changdao.common.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.github.liaochong.myexcel.core.annotation.ExcelColumn;
import com.yx.changdao.common.annotation.AutoFill;
import com.yx.changdao.common.utils.SysUtils;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;


@TableName(CommunityBuildDetail.TABLE_NAME)
@Getter
@Setter
public class CommunityBuildDetail implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 数据库名
     */
    public static final String TABLE_NAME = "community_build_detail";

   /**
    * 人员id
    */
    public static final String ID = "id";
   /**
    * 单元
    */
    public static final String UNIT = "unit";
   /**
    * 层数
    */
    public static final String LAYERS = "layers";
   /**
    * 门牌号
    */
    public static final String DOOR_PLATE = "door_plate";
   /**
    * 是否空户
    */
    public static final String HOUSE_EMPTY = "house_empty";
   /**
    * 建筑物id
    */
    public static final String BUILD_ID = "build_id";
   /**
    * 户主姓名
    */
    public static final String USER_NAME = "user_name";
   /**
    * 家庭住址
    */
    public static final String ADDRESS = "address";
   /**
    * 户主身份证
    */
    public static final String ID_CARD = "id_card";
   /**
    * 是否困难户
    */
    public static final String HARD = "hard";
   /**
    * 用电号
    */
    public static final String USE_ELECTRICITY_CODE = "use_electricity_code";
   /**
    * 用水号
    */
    public static final String USE_WATER_CODE = "use_water_code";
    /**
     * 用水号
     */
    public static final String USE_HEATER_CODE = "use_heater_code";

   /**
    * 是否有退伍军人
    */
    public static final String VETERAN = "veteran";
   /**
    * 是否机关干部
    */
    public static final String GOVERNMENT_UNIT = "government_unit";
   /**
    * 是否党员户
    */
    public static final String COMMUNIST_PARTY = "communist_party";
   /**
    * 是否租住户
    */
    public static final String RENT = "rent";
   /**
    * 是否敏感户
    */
    public static final String ALIVE = "alive";
   /**
    * 户主电话
    */
    public static final String PHONE = "phone";
   /**
    * 建筑物名称
    */
    public static final String BUILD_NAME = "build_name";
   /**
    * 主要收入来源
    */
    public static final String INCOME_FROM = "income_from";
   /**
    * 联系人名字
    */
    public static final String LINK_NAME = "link_name";
   /**
    * 联系电话
    */
    public static final String LINK_PHONE = "link_phone";
    /**
     * 联系电话
     */
    public static final String LINK_ID_CARD = "link_id_card";
   /**
    * 联系人id（worker表）
    */
    public static final String LINK_ID = "link_id";

    /**
     * 联系人名字
     */
    public static final String LINK_NAME2 = "link_name2";
    /**
     * 联系电话
     */
    public static final String LINK_PHONE2 = "link_phone2";
    /**
     * 联系电话
     */
    public static final String LINK_ID_CARD2 = "link_id_card2";
    /**
     * 联系人id（worker表）
     */
    public static final String LINK_ID2 = "link_id2";


   /**
    * 部门名称
    */
    public static final String DEP_NAME = "dep_name";
   /**
    * 部门id
    */
    public static final String DEP_ID = "dep_id";
   /**
    * 创建时间
    */
    public static final String CREATE_TIME = "create_time";
   /**
    * 创建人
    */
    public static final String CREATE_BY_NAME = "create_by_name";
   /**
    * 创建人id
    */
    public static final String CREATE_BY = "create_by";
   /**
    * 更新时间
    */
    public static final String UPDATE_TIME = "update_time";
   /**
    * 更新人
    */
    public static final String UPDATE_BY_NAME = "update_by_name";
   /**
    * 更新人id
    */
    public static final String UPDATE_BY = "update_by";

    /**
     * 联户人小组id
     */
    public static final String CONTACT_GROUP_ID = "contact_group_id";
    /**
     * 联户人组名
     */
    public static final String GROUP_NAME = "group_name";
    /**
     * 家庭人口数
     */
    public static final String FAMILY_POPULATION_NUM = "family_population_num";

   /**
    * 人员id
    */
    @TableId(type = IdType.AUTO)
    private Integer id;

    @ExcelColumn(index = 0,title = "楼编号")
    @TableField(exist = false)
    private String buildCode;
   /**
    * 单元
    */
   @NotNull(message = "单元号/排号不能为空")
   @ExcelColumn(index = 1,title = "单元号/排号")
    private Integer unit;

    /**
     * 门牌号
     */
    @NotNull(message = "室号不能为空")
    @ExcelColumn(index = 2,title = "室号")
    private String doorPlate;

    /**
     * 户主姓名
     */
//    @NotNull(message = "户主名称不允许为空")
    @ExcelColumn(index = 3,title = "户主名称")
    private String userName;
    /**
     * 户主电话
     */
    @ExcelColumn(index = 4,title = "户主手机号")
//    @NotNull(message = "户主手机号不允许为空")
    private String phone;

    /**
     * 户主身份证
     */
//   @NotNull(message = "户主身份证号不允许为空")
    @ExcelColumn(index = 5,title = "户主身份证号")
    private String idCard;

    /**
     * 主要收入来源
     */
    @ExcelColumn(index = 6,title = "主要收入来源")
    private String incomeFrom;

    /**
     * 用水号
     */
    @ExcelColumn(index = 7,title = "家庭水表号")
    private String useWaterCode;
    /**
     * 用电号
     */
    @ExcelColumn(index = 8,title = "家庭电表号")
    private String useElectricityCode;

    /**
     * 暖气号
     */
    @ExcelColumn(index = 9,title = "家庭暖气号")
    private String   useHeaterCode;

    /**
     * 是否党员户
     */
    @ExcelColumn(index = 10,title = "是否党员户",mapping = "0:是,1:否")
    private Integer communistParty;

    /**
     * 是否敏感户
     */
    @ExcelColumn(index = 11,title = "是否敏感户",mapping = "0:是,1:否")
    private Integer alive;

    /**
     * 是否租住户
     */
//    @NotNull(message = "是否租住户不能为空")
    @ExcelColumn(index = 12,title = "是否租住户",mapping = "0:是,1:否")
    private Integer rent;

    /**
     * 是否困难户
     */
    @ExcelColumn(index = 13,title = "是否困难户",mapping = "0:是,1:否")
    private Integer hard;
    /**
     * 是否空户
     */
    @NotNull(message = "是否空户不能为空")
    @ExcelColumn(index = 14,title = "是否空户",mapping = "0:是,1:否")
    private Integer houseEmpty;
    /**
     * 是否机关干部
     */
    @ExcelColumn(index = 15,title = "是否机关干部户",mapping = "0:是,1:否")
    private Integer governmentUnit;
    /**
     * 是否有退伍军人
     */
    @ExcelColumn(index = 16,title = "是否退伍军人户",mapping = "0:是,1:否")
    private Integer veteran;
    /**
     * 联户人小组id
     */
    @ExcelColumn(index = 17,title = "联户人小组id")
    @NotNull(message = "联户组不允许为空")
    private Integer contactGroupId;
    /**
     * 联户人小组名
     */
    @ExcelColumn(index = 18,title = "联户人小组名")
    private String groupName;
    /**
     * 部门名称
     */
//    @ExcelColumn(index = 17,title = "联系部门")
    private String depName;

    /**
     * 联系人名字
     */

    private String linkName;
    /**
     * 联系电话
     */

    private String linkPhone;
    /**
     * 联系人id（worker表）
     */
    private Integer linkId;
    /**
     * 联络人身份证
     */

    private String linkIdCard;

    /**
     * 联系人名字
     */

    private String linkName2;
    /**
     * 联系电话
     */

    private String linkPhone2;
    /**
     * 联系人id（worker表）
     */
    private Integer linkId2;
    /**
     * 联络人身份证
     */

    private String linkIdCard2;

//    @NotNull(message = "家庭人口数不能为空")
   private String familyPopulationNum;




    /**
    * 层数
    */
    private Integer layers;


   /**
    * 建筑物id
    */
    private Integer buildId;

   /**
    * 家庭住址
    */
    private String address;


   /**
    * 建筑物名称
    */
   private String buildName;







   /**
    * 部门id
    */
    private Integer depId;
   /**
    * 创建时间
    */
    @AutoFill
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    /**
     * 创建人
     */
    @AutoFill(klass= SysUtils.class,method = "currentUserName")
    @TableField(fill = FieldFill.INSERT)
    private String createByName;
   /**
    * 创建人id
    */
   @AutoFill(klass= SysUtils.class,method = "currentUserId")
   @TableField(fill = FieldFill.INSERT)
    private String createBy;
   /**
    * 更新时间
    */
    @AutoFill
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;
    /**
     * 更新人
     */
    @AutoFill(klass= SysUtils.class,method = "currentUserName")
    @TableField(fill = FieldFill.UPDATE)
    private String updateByName;
   /**
    * 更新人id
    */
   @AutoFill(klass= SysUtils.class,method = "currentUserId")
   @TableField(fill = FieldFill.UPDATE)
   private String updateBy;

    /**
     * 楼类型临时字段
     */
    @TableField(exist = false)
    private Integer buildType;
}
